// deno run --allow-read --allow-write xxtea-utils.ts
console.log("XXTEA 加密 CLI")
console.log(Deno.args);

import XXTEA from "https://deno.land/x/xxtea@v0.1.0/mod.ts";

const basePath = ""

const inputFilesPath = basePath + "kkbt/xxtea/"
for (const file of Deno.readDirSync(inputFilesPath)) {
    console.log(file.name);
    if (file.isFile) {
        const text = Deno.readTextFileSync(inputFilesPath + file.name)
        const data = XXTEA.encryptToBase64(text, "password");
        Deno.writeTextFileSync(basePath + "kkbt/xxtea/output/" + file.name + ".xxtea.txt", data);
    }

}